import yaml
class YamlOp:
    def __init__(self,path='../../config/locator.yaml'):
        with open(path,encoding='utf8') as fp:
            self.data = yaml.load(fp,Loader=yaml.FullLoader)

    def get_locator(self,page,name):
        return self.data[page][name]

# a = YamlOp('data.yaml')
# print(a.get_locator('LoginPage','password'))
# a = YamlOp()
# print(a.get_locator('CustomerPage','Number'))